<!--
 * @Descripttion: 
 * @version: 
 * @Author: gonghong
 * @Date: 2023-10-25 
-->
<script>
    import FormModal from './FormModal.vue'
    import CommonMethods from '../mixins/CommonMethods'
    import holdConfig from './holdConfig.vue'

    export default {
        name: 'Operation',
        props: {
            rowData: {
                type: Object,
                default: () => {
                    return {}
                },
            },
        },
        inject: ['tableRoot'],
        mixins: [CommonMethods],
        methods: {
            /**
             * @name: 编辑
             * @test: test font
             * @msg:
             * @return {*}
             */
            editClick() {
                new this.$pageModal(
                    FormModal,
                    {
                        props: {
                            title: '编辑',
                            rowData: this.$props.rowData,
                        },
                    },
                    (result) => {
                        if (result) {
                            this.tableRoot.onSearchChange()
                        }
                    }
                )
            },
            configClick(rowData) {
                new this.$pageModal(
                    // FormModal,
                    // addConfig,
                    holdConfig,
                    {
                        props: {
                            title: '配置',
                            id: rowData.id,
                        },
                    },
                    (result) => {
                        if (result) {
                            this.tableRoot.onSearchChange()
                        }
                    }
                )
            },
        },
    }
</script>
<template>
    <Space>
        <el-tooltip class="item" effect="light" content="编辑" placement="bottom-start">
            <el-button type="text" icon="el-icon-edit" @click="editClick" />
        </el-tooltip>
        <el-tooltip class="item" effect="light" content="配置" placement="bottom-start">
            <el-button
                type="text"
                icon="el-icon-s-operation mouse-pointer"
                @click="configClick(rowData)"
            />
        </el-tooltip>
        <el-tooltip class="item" effect="light" content="删除" placement="bottom-start">
            <el-button icon="el-icon-delete" type="text" @click="onDeleteClick(rowData)" />
        </el-tooltip>
    </Space>
</template>
